package oop.ex3.usercommands;

import java.util.TreeSet;

import oop.ex3.filemanager.FileManager;

public class Dir extends UserMessage{

	public static final String COMMAND="DIR";
	
	public Dir(FileManager fileManager) {
		super(fileManager);
	}

	/**
	 * Runs the Dir UserMessage.
	 * prints all the FileManager's file-names,
	 * each in a new line, alphabetically ordered.
	 */
	public boolean run(){
		TreeSet<String> fileList = this._fileManager.getFileList();
		for (String fileName : fileList){
			System.out.println(fileName);
		}
		return SUCCESS;
	}
}
